package info;

import java.util.List;


/**
 * The Recommendation is an immutable object that holds the data for the recommendation
 * forms after one has been filled out by a Subprogram Chair.
 * 
 * @author Aaron Chen
 * @version 3/8/2014
 */
public class Recommendation {
  
  /** The index in which the reviewer name will be found in the input list. */
  private static final int FIELDS_SPC_INDEX = 0;
  
  /** The index in which the conference will be found in the input list. */
  private static final int FIELDS_CONFERENCE_INDEX = 1;
  
  /** The index in which the manuscript author will be found in the input list. */
  private static final int FIELDS_AUTHOR_INDEX = 2;
  
  /** The index in which the manuscript title will be found in the input list. */
  private static final int FIELDS_TITLE_INDEX = 3;
  

  /** The identification number for this recommendation. */
  private long my_id;
  
  /** The name of the reviewer that completed the review submission form. */
  private String my_subprogram_chair_name;

  /** The conference that the reviewed manuscript was submitted to. */
  private String my_conference;

  /** The author of the manuscript that was reviewed. */
  private String my_manuscript_author;

  /** The title of the manuscript that was reviewed. */
  private String my_manuscript_title;
  
  /** The rating from 1 to 5 for the overall quality of the manuscript. */
  private int my_summary_rating;

  /** The rating comments. */
  private String my_rationale;
  
  
  /**
   * Constructs a new Recommendation immutable object.
   * @param the_id              The identification number for this Recommendation.
   * @param the_fields          The answers supplied in the single-line fields.
   * @param the_summary_rating  The overall quality rating for the manuscript.
   * @param the_rationale       The detailed rationale for the overall quality.
   */
  public Recommendation(final long the_id,
                        final List<String> the_fields,
                        final int the_summary_rating,
                        final String the_rationale) {
    my_id = the_id;
    my_subprogram_chair_name = the_fields.get(FIELDS_SPC_INDEX);
    my_conference = the_fields.get(FIELDS_CONFERENCE_INDEX);
    my_manuscript_author = the_fields.get(FIELDS_AUTHOR_INDEX);
    my_manuscript_title = the_fields.get(FIELDS_TITLE_INDEX);
    my_summary_rating = the_summary_rating;
    my_rationale = the_rationale;
  }

  /**
   * Returns the identification number of the recommendation.
   * @return The identification number.
   */
  public long getID() {
    return my_id;
  }
  /**
   * Sets the identification number of the recommendation.
   * @param the_id The identification number.
   */
  public void setID(final long the_id) {
    my_id = the_id;
  }
  /**
   * Returns the name of the Subprogram Chair that completed the recommendation form.
   * @return The Subprogram Chair's name.
   */
  public String getSubprogramChairName() {
    return my_subprogram_chair_name;
  }
  /**
   * Returns the conference that the reviewed manuscript was submitted to.
   * @return The conference.
   */
  public String getConference() {
    return my_conference;
  }
  /**
   * Returns the reviewed manuscript's author.
   * @return The author of the manuscript.
   */
  public String getManuscriptAuthor() {
    return my_manuscript_author;
  }
  /**
   * Returns the reviewed manuscript's title.
   * @return The title of the manuscript.
   */
  public String getManuscriptTitle() {
    return my_manuscript_title;
  }
  /**
   * Returns a rating from 1 to 5 representing the overall quality of the manuscript.
   * @return A rating from 1 to 5 representing the overall quality of the manuscript.
   */
  public int getSummaryRating() {
    return my_summary_rating;
  }
  /**
   * Returns the rationale for the recommendation rating.
   * @return The review summary.
   */
  public String getRationale() {
    return my_rationale;
  }

  
  
}
